package com.itlong.cloud.project.operate;

import com.itlong.cloud.POJO.DTO.operate.OperateSceneGetPageDTO;
import com.itlong.cloud.POJO.DTO.operate.OperateSceneSaveDTO;
import com.itlong.cloud.POJO.PO.OperateScenePO;
import com.itlong.cloud.POJO.VO.operate.OperateSceneVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <desc>
 * 场景
 * </desc>
 *
 * @createDate 2021-03-25
 */
@FeignClient(name = "project-service")
public interface IOperateSceneServiceClient {

    /**
     * <desc>
     * 添加场景
     * <desc/>
     *
     * @param saveDTO 新增场景信息
     * @return
     * @author zhouchun
     * @createDate 2021-03-25
     */
    @RequestMapping(path = "/operate/scene/add", method = RequestMethod.POST)
    Integer saveScene(@RequestBody OperateSceneSaveDTO saveDTO) throws Exception;

    /**
     * <desc>
     * 修改场景
     * <desc/>
     *
     * @param saveDTO 修改场景信息
     * @return
     * @author zhouchun
     * @createDate 2021-03-25
     */
    @RequestMapping(path = "/operate/scene/update", method = RequestMethod.POST)
    Integer updateScene(@RequestBody OperateSceneSaveDTO saveDTO) throws Exception;

    @RequestMapping(path = "/operate/scene/getCountByName", method = RequestMethod.POST)
    Integer getCountByName(@RequestParam("name") String name);

    @RequestMapping(path = "/operate/scene/getExcludeCountByName", method = RequestMethod.POST)
    Integer getExcludeCountByName(@RequestParam("name") String name, @RequestParam("sceneKey") String sceneKey);

    @RequestMapping(path = "/operate/scene/getOneBySceneId", method = RequestMethod.POST)
    OperateScenePO getOneBySceneId(@RequestParam("sceneId") String sceneId);

    /**
     * <desc>
     * 分页获取场景信息
     * <desc/>
     *
     * @param pageDTO 分页获取场景信息条件对象
     * @return
     * @author zhouchun
     * @createDate 2021-03-26
     */
    @RequestMapping(path = "/operate/scene/getPage", method = RequestMethod.POST)
    Page<OperateSceneVO> getPage(@RequestBody OperateSceneGetPageDTO pageDTO) throws Exception;

    @RequestMapping(path = "/operate/scene/userTypeIdCanDelete", method = RequestMethod.POST)
    Integer userTypeIdCanDelete(@RequestParam("userTypeId") String userTypeId);

    @RequestMapping(path = "/operate/scene/delete", method = RequestMethod.POST)
    Integer delete(@RequestBody OperateScenePO m);

}